package com.ikkong.core.intercept;

import com.ikkong.common.vo.ShiroUser;
import com.ikkong.core.annotation.DoLog;
import com.ikkong.core.jfinal.ext.kit.JStrKit;
import com.ikkong.core.jfinal.ext.shiro.ShiroKit;
import com.ikkong.core.toolbox.Func;
import com.ikkong.core.toolbox.log.LogManager;
import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import com.jfinal.core.Controller;
import com.jfinal.kit.LogKit;

import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;
import java.util.Enumeration;
import java.util.Map;
import java.util.logging.Logger;

/**
 * 记录日志
 * 
 * @author ikkong
 *
 */
public class GlobalActionInterceptor implements Interceptor {
	static Logger logger = Logger.getLogger("GlobalActionInterceptor");// 一般为当前的类名

	public void intercept(Invocation inv) {
		Controller controller = inv.getController();
		controller.getResponse().setHeader("Access-Control-Allow-Origin", "*");
		controller.getResponse().addHeader("Access-Control-Allow-Headers", "*");
		controller.getResponse().addHeader("Access-Control-Allow-Credentials", "true");
		inv.invoke();
	}
}
